<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	// 实现删除字符串中出现次数最少的字符，若出现次数最少的字符有多个，则把出现次数最少的字符都删除。输出删除这些单词后的字符串，字符串中其它字符保持原来的顺序。
	function deleteMinChar(str){
		const map = {}
		for(let i of str){
			if (map[i]){
				map[i] = map[i] + 1
			} else {
				map[i] = 1
			}
		}
		const nums = []
		for(let i in map){
			nums.push(map[i])
		}
		const min = Math.min(...nums)
		for(let i in map){
			if (map[i] === min){
				str = str.replaceAll(i,'')
			}
		}
		return str
	}
	
	console.log(deleteMinChar('dhhjahsjhgfhdhdhssjjjjhhhdjjsjsjjjjjjjjjjjj'))
</script>
</html>